//https://leetcode.cn/problems/min-cost-climbing-stairs/?envType=study-plan&id=dong-tai-gui-hua-ru-men&plan=dynamic-programming&plan_progress=y5pmr12
int minCostClimbingStairs(int* cost, int costSize)
{
    int cur = 0;
    int prev = 0;

    int i = 2;
    while (i <= costSize)
    {
        int tmp = (cur + cost[i - 1]) > (prev + cost[i - 2]) ? (prev + cost[i - 2]) : (cur + cost[i - 1]);
        prev = cur;
        cur = tmp;
        ++i;
    }
    return cur;
}


